/*    */ package net.gxf.learn.one;
/*    */ 
/*    */ import java.io.PrintStream;
/*    */ import org.lwjgl.LWJGLException;
/*    */ import org.lwjgl.input.Keyboard;
/*    */ import org.lwjgl.input.Mouse;
/*    */ import org.lwjgl.opengl.Display;
/*    */ import org.lwjgl.opengl.DisplayMode;
/*    */ 
/*    */ public class InputExample
/*    */ {
/*    */   public void start()
/*    */   {
/*    */     try
/*    */     {
/* 17 */       Display.setDisplayMode(new DisplayMode(800, 600));
/* 18 */       Display.create();
/*    */     } catch (LWJGLException e) {
/* 20 */       e.printStackTrace();
/* 21 */       System.exit(0);
/*    */     }
/*    */ 
/* 26 */     while (!Display.isCloseRequested())
/*    */     {
/* 30 */       pollInput();
/* 31 */       Display.update();
/*    */     }
/*    */ 
/* 34 */     Display.destroy();
/*    */   }
/*    */ 
/*    */   public void pollInput()
/*    */   {
/* 39 */     if (Mouse.isButtonDown(0)) {
/* 40 */       int x = Mouse.getX();
/* 41 */       int y = Mouse.getY();
/*    */ 
/* 43 */       System.out.println("MOUSE DOWN @ X: " + x + " Y: " + y);
/*    */     }
/*    */ 
/* 46 */     if (Keyboard.isKeyDown(57)) {
/* 47 */       System.out.println("SPACE KEY IS DOWN");
/*    */     }
/*    */ 
/* 50 */     while (Keyboard.next())
/* 51 */       if (Keyboard.getEventKeyState()) {
/* 52 */         if (Keyboard.getEventKey() == 30) {
/* 53 */           System.out.println("A Key Pressed");
/*    */         }
/* 55 */         if (Keyboard.getEventKey() == 31) {
/* 56 */           System.out.println("S Key Pressed");
/*    */         }
/* 58 */         if (Keyboard.getEventKey() == 32)
/* 59 */           System.out.println("D Key Pressed");
/*    */       }
/*    */       else {
/* 62 */         if (Keyboard.getEventKey() == 30) {
/* 63 */           System.out.println("A Key Released");
/*    */         }
/* 65 */         if (Keyboard.getEventKey() == 31) {
/* 66 */           System.out.println("S Key Released");
/*    */         }
/* 68 */         if (Keyboard.getEventKey() == 32)
/* 69 */           System.out.println("D Key Released");
/*    */       }
/*    */   }
/*    */ 
/*    */   public static void main(String[] argv)
/*    */   {
/* 76 */     InputExample inputExample = new InputExample();
/* 77 */     inputExample.start();
/*    */   }
/*    */ }

/* Location:           C:\DBDownload\lwjglDemo2\lwjglDemo2\Run.jar
 * Qualified Name:     com.learn.one.InputExample
 * JD-Core Version:    0.6.2
 */